<?php
class MessageAction extends Action {
	
	public function index(){
		if ($_POST['name'] && $_POST['email'] && $_POST['comment']){
			$Message = M("Message");
			
			$data['msg_name'] = $_POST['name'];
			$data['msg_email'] = $_POST['email'];
			$data['msg_comment'] = $_POST['comment'];
			$data['msg_time'] = date('Y-m-d H:i:s');
			$data['msg_state'] = "正常";
			if ($Message->add($data)){
				echo "success";
			}else{
				echo "fault";
			}
		}
	}
	
}